const path = require('node:path');

// eslint-disable-next-line import/no-extraneous-dependencies
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  mode: 'development',
  devtool: 'source-map',
  devServer: {
    hot: true,
    port: 9000,
    open: true,
    historyApiFallback: true,
  },
  entry: path.resolve('examples/src/index.js'),
  output: {
    path: path.resolve('examples/dist'),
  },
  module: {
    rules: [
      {
        test: /\.txt$/,
        use: './dist/index.js',
      },
    ],
  },
  plugins: [new HtmlWebpackPlugin({})],
};
